﻿<%@ Page Title="Gymnastics " Language="C#" AutoEventWireup="true" CodeFile="Gymnastics.aspx.cs" Inherits="Gymnastics" MasterPageFile="~/Site.master" %>



<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Gymnastics
    </h2>
    <p>
        ADD DATA FOR A MEET</p>
    <p>
        <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" 
            AutoGenerateRows="False" BackColor="White" BorderColor="#3366CC" 
            BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="MeetName" 
            DataSourceID="MeetDataSource" Height="50px" Width="125px">
            <EditRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
            <Fields>
                <asp:BoundField DataField="USAGNumber" HeaderText="USAGNumber" 
                    SortExpression="USAGNumber" />
                <asp:BoundField DataField="VaultScore" HeaderText="VaultScore" 
                    SortExpression="VaultScore" />
                <asp:BoundField DataField="FloorScore" HeaderText="FloorScore" 
                    SortExpression="FloorScore" />
                <asp:BoundField DataField="BarsScore" HeaderText="BarsScore" 
                    SortExpression="BarsScore" />
                <asp:BoundField DataField="BeamScore" HeaderText="BeamScore" 
                    SortExpression="BeamScore" />
                <asp:BoundField DataField="Position" HeaderText="Position" 
                    SortExpression="Position" />
                <asp:BoundField DataField="TeamPosition" HeaderText="TeamPosition" 
                    SortExpression="TeamPosition" />
                <asp:BoundField DataField="MeetName" HeaderText="MeetName" ReadOnly="True" 
                    SortExpression="MeetName" />
                <asp:BoundField DataField="date" HeaderText="date" SortExpression="date" />
                <asp:BoundField DataField="VaultPosition" HeaderText="VaultPosition" 
                    SortExpression="VaultPosition" />
                <asp:BoundField DataField="FloorPosition" HeaderText="FloorPosition" 
                    SortExpression="FloorPosition" />
                <asp:BoundField DataField="BarsPosition" HeaderText="BarsPosition" 
                    SortExpression="BarsPosition" />
                <asp:BoundField DataField="BeamPosition" HeaderText="BeamPosition" 
                    SortExpression="BeamPosition" />
                <asp:CommandField ShowEditButton="True" ShowInsertButton="True" />
            </Fields>
            <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
            <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
            <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
            <RowStyle BackColor="White" ForeColor="#003399" />
        </asp:DetailsView>
    </p>
    <p>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
            BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
            DataKeyNames="MeetName" DataSourceID="MeetViewDataSource">
            <Columns>
                <asp:BoundField DataField="Overall" HeaderText="Overall" 
                    SortExpression="Overall" ReadOnly="True" />
                <asp:BoundField DataField="VaultScore" HeaderText="Vault Score" 
                    SortExpression="VaultScore" />
                <asp:BoundField DataField="VaultPosition" HeaderText="Vault Position" 
                    SortExpression="VaultPosition" />
                <asp:BoundField DataField="FloorScore" HeaderText="Floor Score" 
                    SortExpression="FloorScore" />
                <asp:BoundField DataField="FloorPosition" HeaderText="Floor Position" 
                    SortExpression="FloorPosition" />
                <asp:BoundField DataField="BarsScore" HeaderText="Bars Score" 
                    SortExpression="BarsScore" />
                <asp:BoundField DataField="BarsPosition" HeaderText="Bars Position" 
                    SortExpression="BarsPosition" />
                <asp:BoundField DataField="BeamScore" HeaderText="Beam Score" 
                    SortExpression="BeamScore" />
                <asp:BoundField DataField="BeamPosition" HeaderText="Beam Position" 
                    SortExpression="BeamPosition" />
                <asp:BoundField DataField="Position" HeaderText="Position" 
                    SortExpression="Position" />
                <asp:BoundField DataField="TeamPosition" HeaderText="Team Position" 
                    SortExpression="TeamPosition" />
                <asp:BoundField DataField="MeetName" HeaderText="Meet Name" 
                    SortExpression="MeetName" ReadOnly="True" />
                <asp:BoundField DataField="date" HeaderText="date" SortExpression="date" />
            </Columns>
            <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
            <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
            <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
            <RowStyle BackColor="White" ForeColor="#003399" />
            <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
            <SortedAscendingCellStyle BackColor="#EDF6F6" />
            <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
            <SortedDescendingCellStyle BackColor="#D6DFDF" />
            <SortedDescendingHeaderStyle BackColor="#002876" />
        </asp:GridView>
        <asp:SqlDataSource ID="MeetViewDataSource" runat="server" 
            ConnectionString="<%$ ConnectionStrings:GymnasticsConnectionString %>" 
            SelectCommand="SELECT VaultScore + FloorScore + BarsScore + BeamScore AS Overall, VaultScore,VaultPosition, FloorScore,FloorPosition, BarsScore,BarsPosition, BeamScore,BeamPosition, Position, TeamPosition, MeetName, date FROM Meet">
        </asp:SqlDataSource>
    </p>
    <p>
        &nbsp;</p>
    <p>
        <asp:SqlDataSource ID="MeetDataSource" runat="server" 
            ConnectionString="<%$ ConnectionStrings:GymnasticsConnectionString %>" 
            DeleteCommand="DELETE FROM [Meet] WHERE [MeetName] = @MeetName" 
            InsertCommand="INSERT INTO [Meet] ([USAGNumber], [VaultScore], [FloorScore], [BarsScore], [BeamScore], [Position], [TeamPosition], [MeetName], [date], [VaultPosition], [FloorPosition], [BarsPosition], [BeamPosition]) VALUES (@USAGNumber, @VaultScore, @FloorScore, @BarsScore, @BeamScore, @Position, @TeamPosition, @MeetName, @date, @VaultPosition, @FloorPosition, @BarsPosition, @BeamPosition)" 
            SelectCommand="SELECT * FROM [Meet]" 
            
            UpdateCommand="UPDATE [Meet] SET [USAGNumber] = @USAGNumber, [VaultScore] = @VaultScore, [FloorScore] = @FloorScore, [BarsScore] = @BarsScore, [BeamScore] = @BeamScore, [Position] = @Position, [TeamPosition] = @TeamPosition, [date] = @date, [VaultPosition] = @VaultPosition, [FloorPosition] = @FloorPosition, [BarsPosition] = @BarsPosition, [BeamPosition] = @BeamPosition WHERE [MeetName] = @MeetName">
            <DeleteParameters>
                <asp:Parameter Name="MeetName" Type="String" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="USAGNumber" Type="Int32" />
                <asp:Parameter Name="VaultScore" Type="Single" />
                <asp:Parameter Name="FloorScore" Type="Single" />
                <asp:Parameter Name="BarsScore" Type="Single" />
                <asp:Parameter Name="BeamScore" Type="Single" />
                <asp:Parameter Name="Position" Type="Int32" />
                <asp:Parameter Name="TeamPosition" Type="Int32" />
                <asp:Parameter Name="MeetName" Type="String" />
                <asp:Parameter Name="date" Type="DateTime" />
                <asp:Parameter Name="VaultPosition" Type="Int32" />
                <asp:Parameter Name="FloorPosition" Type="Int32" />
                <asp:Parameter Name="BarsPosition" Type="Int32" />
                <asp:Parameter Name="BeamPosition" Type="Int32" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="USAGNumber" Type="Int32" />
                <asp:Parameter Name="VaultScore" Type="Single" />
                <asp:Parameter Name="FloorScore" Type="Single" />
                <asp:Parameter Name="BarsScore" Type="Single" />
                <asp:Parameter Name="BeamScore" Type="Single" />
                <asp:Parameter Name="Position" Type="Int32" />
                <asp:Parameter Name="TeamPosition" Type="Int32" />
                <asp:Parameter Name="date" Type="DateTime" />
                <asp:Parameter Name="VaultPosition" Type="Int32" />
                <asp:Parameter Name="FloorPosition" Type="Int32" />
                <asp:Parameter Name="BarsPosition" Type="Int32" />
                <asp:Parameter Name="BeamPosition" Type="Int32" />
                <asp:Parameter Name="MeetName" Type="String" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </p>
</asp:Content>

